package com.example.zjsr.domain;


import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 用户类
 */
//属性为空或者NULL都不序列化
@Data
public class User {
    @ExcelProperty("用户id")
    private Integer id;//主键id
    @ExcelProperty("用户名")
    private String username;//用户名
    @ExcelProperty("登录名")
    private String loginName;//登录名
    @ExcelProperty("登录密码")
    private String password;//登陆密码
    @ExcelIgnore
    private String email;//邮箱
    @ExcelIgnore
    private Role role;//角色 复合类型
    @ExcelProperty("角色id")
    private Integer roleId;//角色id
    @ExcelIgnore
    private Date createTime;//创建时间
    @ExcelIgnore
    private Date updateTime;//更新时间
    @ExcelProperty("学校")
    private String school;//学校
    @ExcelIgnore
    private String province;//省份
    @ExcelIgnore
    private String city;//城市
    @ExcelIgnore
    private String address;//所在地
    @ExcelProperty("班级")
    private String classes;//班级
    // important 验证码不存入数据库，存入redis


    @ExcelIgnore
    private Date updatePasswordTime;
    @ExcelIgnore
    private String accessToken;
    @ExcelIgnore
    private String checkCode;



    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", loginName='" + loginName + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", role=" + role +
                ", roleId=" + roleId +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", school='" + school + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", address='" + address + '\'' +
                ", classes='" + classes + '\'' +
                ", checkCode='" + checkCode + '\'' +
                '}';
    }
}
